package com.uplooking.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

import com.uplooking.pojo.User;

@Component
public class UserDao {
    
	@Autowired
	JdbcTemplate jdbcTemplate;
	
	public User findById(int id) {
		
		
		return jdbcTemplate.queryForObject(
	    "select * from user where uid =?", new BeanPropertyRowMapper<User>(User.class),id);
		
	}
}
